public class Test26 {
    public static void main(String[] args) {
        int[] i ={19,16,13,18,15,12,17,14,11};
        //冒泡法排序
        for (int j = i.length-1; j >0 ; j--) {
            for (int k = 0; k <j ; k++) {
                if (i[k] > i[k+1]) {
                    int temp;
                    temp = i[k];
                    i[k] = i[k + 1];
                    i[k + 1] = temp;
                }
            }
        }
        //顺列数组
        for (int j = 0; j < i.length ; j++) {
            System.out.println("+++++"+i[j]);
        }
        //选择排序法
        for (int j = 0; j < i.length-1 ; j++) {
            for (int k = j+1; k <i.length ; k++) {
                if (i[j] > i[k]) {
                    int temp;
                    temp = i[j];
                    i[j] = i[k];
                    i[k] = temp;
                }
            }
        }
        //顺列数组
        for (int j = 0; j < i.length ; j++) {
                System.out.println("---"+i[j]);
        }
    }
}


